#include "udpClient.hpp"

#include <memory>

using namespace std;
using namespace client;

void Usage(const string& proc)
{
    cout<<"\nUsage:\n\t"<<proc<<"local_port\n\n";
}

//  ./udpClient serverip serverport
int main(int argc,char* argv[])
{
    if(argc!=3)
    {
        Usage(argv[0]);
        exit(2);
    }

    string serverip = argv[1];
    uint16_t serverport = atoi(argv[2]);

    unique_ptr<udpClient> ucli (new udpClient(serverip,serverport));

    ucli->initeClient();
    ucli->run();

    return 0;
}